<template>
  <div class="item">
    <div class="left-bar">
      <img :src=" itemData.images.split(',')[0] ">
    </div>
    <div class="info-bar">
      <p>{{ itemData.typeName }}</p>
      <span class="des">{{ itemData.des }}</span>
      <span class="price">{{ itemData.typePrice }}</span>
      <router-link class="detail" :to="{name:'detail', params:{itemData}}">
        预约入住
      </router-link>
    </div>
  </div>
</template>

<script>
export default {
  name: "Goods-list-item",
  props:["itemData"],
  data(){
    return{
      item:{}
    }
  },
  mounted() {
    this.item = this.itemData;
  }
}
</script>

<style scoped lang="less">
.item{
  position: relative;

  .left-bar{
    width: 385px;
    height: 200px;
    display: block;
    background: #51446e;
    //border-radius: 25px 25px 0 0;
    transition: 0.5s ease;
    z-index: 0;
    overflow: hidden;
    position: relative;

    img{
      width: 100%;
      transition: all 2s;
      transform: scale(1.4);
    }
  }
  .info-bar{
    display: block;
    transition: 0.5s ease;
    width: 385px;
    height: 50px;
    padding-top: 8px;
    padding-left: 20px;
    background: rgba(255,255,255,0.7);
    //border-radius: 0 0 25px 25px;
    z-index: 4;
    position: relative;


    *{
      display: none;
    }
    p{
      font-weight: bold;
      font-size: 24px;
      display: block;
    }
    .des{
      margin-top: 10px;
      color: grey;
      padding: 10px;
    }

    .price{
      display: block;
      font-size: 28px;
      font-weight: bolder;
      color: red;
      position: absolute;
      bottom: 10px;
      right: 25px;

      &:after{
        content: "元/晚";
        color:black;
        font-size: 14px;
        position: relative;
        right: -10px;
        bottom: 2px;
      }
    }

    .label-container{
      width: 100%;
      min-height: 21px;

      .label{
        text-align: center;
        width: 20%;
        height: 20px;
        background-color: lightyellow;
        margin-top: 5px;
        box-shadow: 0 0 2px 0 rgba(0, 0, 0, 0.1);
        user-select: none;
        color: grey;
      }
    }

  }
  &:hover{
    .left-bar{
      //border-radius: 25px 25px 0 0 ;
      img{
        width: 100%;
      }
    }
    .info-bar{
      transform: scaleX(1);
      height: 350px;
      //border-radius: 0 0 25px 25px;
      padding: 20px;
      background-color: #FFFFFF;
      text-align: left;

      *{
        display: block;
      }
      .price{
        position: absolute;
        bottom: 10px;
        right: 25px;
      }
      .label-container{
        display: flex;
        justify-content: flex-start;
        .label{
          margin-right: 15px;
        }
      }
      .detail{
        width: 120px;
        line-height: 30px;
        font-size: 18px;
        text-align: center;
        background-color: #ffb508;
        position: absolute;
        bottom: 15px;
        user-select: none;
        cursor: pointer;
        box-sizing: border-box;
        border: solid #ffb508 2px;
        color: #3a3a3a;

        &:hover{
          border: solid #ffb508 2px;
          background-color: #FFFFFF;
        }
      }
    }
  }
}
</style>